package com.itdl.lock.exception;

import com.itdl.lock.enums.LockErrCode;
import lombok.Data;

/**
 * Redis分布式锁异常
 */
@Data
@SuppressWarnings("all")
public class RedisLockException extends RuntimeException{
    private final String code;
    private final String msg;

    public RedisLockException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public RedisLockException(LockErrCode errCode) {
        this.code = errCode.getCode();
        this.msg = errCode.getMsg();
    }
}
